import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/', // 登录analysis
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/Denglu-Login.vue')
  },
  {  // 店铺信息修改
    path: '/modify-infor',
    name: 'modify-infor',
    component: () => import(/* webpackChunkName: "ModifyInfor" */ '../components/dianpu-ModifyInfor.vue')
  },
  {
    path: '/Index', // 首页
    component: () => import(/* webpackChunkName: "Index" */ '../views/index/Shouye-Index.vue'),
    // 店铺信息
    redirect: '/store',
    // 首页的子路由
    children: [
      // { path: '/', redirect: '/Store' }, // 店铺信息
      {
        path: '/upload',// 添加菜品
        name: 'upload',
        component: () => import(/* webpackChunkName: "upload" */ '../components/tianjia-upload.vue')
      },
      {
        path: '/table', // 座号管理
        name: 'table',
        component: () => import(/* webpackChunkName: "table" */ '../views/zhuohao-table/zhuohao-table.vue')
      },
      {
        path: '/menus', // 菜单管理
        name: 'menus',
        component: () => import(/* webpackChunkName: "menus" */ '../views/caidan-menus/caidan-menus.vue')
      },
      {
        path: '/category',// 菜品类目
        name: 'category',
        component: () => import(/* webpackChunkName: "category" */ '../views/caipin-category/caipin-category.vue')
      },
      {
        path: '/order', // 订单管理
        name: 'order',
        component: () => import(/* webpackChunkName: "order" */ '../views/dingdan-order/dingdan-order.vue')
      },
      {
        path: '/analysis', // 数据分析
        name: 'analysis',
        component: () => import(/* webpackChunkName: "analysis" */ '../views/suoju-analysis/suoju-analysis.vue')
      },
      { // 店铺信息
        path: '/store',
        name: 'store',
        component: () => import(/* webpackChunkName: "store" */ '../views/dianpu-store/dianpu-store.vue')
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
